package com.qianke.core.service.impl;

import com.qianke.domain.entity.AdminUser;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class RedisService {
    @Resource
    private RedisTemplate<String, Object> redisTemplate;

    public void setObj(String key, AdminUser value) {
        redisTemplate.opsForValue().set(key, value);
    }

    public AdminUser getObj(String key) {
        return (AdminUser) redisTemplate.opsForValue().get(key);
    }
}
